home *** CD-ROM | disk | FTP | other *** search
- #ifdef GNUC
- #include <stdlib.h>
- #endif
-
- #ifndef MALLOC_DEBUG
- void xfree( m )
- char *m;
- {
- if(m==(char *)0) return;
- free(m);
- return;
- }
- void *xmalloc(m)
- {
- return((void *)malloc(m));
- }
-
- #else
- #include <stdio.h>
- #include <malloc.h>
- static int seq; /* sequence number */
- extern FILE *mall_deb;
- void xfree(p, f,l)
- char *p;
- char *f; /* filename of call to free */
- int l; /* line number */
- {
- if(mall_deb) fprintf(mall_deb,"%8x %8d %-14s %6d FREE \n",p,seq++,f,l);
- if(p==(char *)0) return;
- free(p);
- return;
- }
- void *xmalloc(m,f,l)
- int m;
- char *f,*l;
- {
- char *al;
- al=malloc(m);
- if(mall_deb) fprintf(mall_deb,"%8x %8d %-14s %6d MALLOC %10d \n",al,seq++,f,l,m);
- return(al);
- }
- #endif
-